<div class="container"> 
<!-- middle -->
<div id="middle" class="cols2">
	
    <div class="title">
    	<h1><?=$post['post_title']?></h1>
        <div class="post-meta">
	    	<span class="tags">
				<a href="#"><?=$post['post_day'].' '.$post['post_month'].' '.$post['post_year']?></a>
				<a href="#"><?=$post['user_name']?></a>
			</span>
				<?php if($this->session->userdata('user_login')== $post['EmployeeID']): ?>
				<a href="#" class="author"><?=anchor('post/edit/'.$post['post_id'],'Update News')?></a> <span class="separator">|</span>
				<a href="#" class="author"><?=anchor('post/remove/'.$post['post_id'],'Remove News')?></a> <span class="separator">|</span>
				<?php endif;?>
	   </div>
    </div>  
    
    <div class="content" role="main">
       
    	<article class="post-detail">            
			<div class="entry">
            
	            <div class="frame_box">
	            <img src="<?=base_url().postImage($post['post_image'])?>" style="width:740;height:100%" alt="">
	            </div>
					<?=$post['post_content']?>	
				
				<?php 
					$i=1;
					foreach($images as $row):?>
					<div class="row">
						<?php if($i % 2== 1): ?>
						<div class="col col_1_2 alpha">
							<div class="inner">
								<img src="<?=base_url('assets/post/'.$row['image_name'])?>" style="width:290px;height=199px" />
							</div>
						</div>
						<?php endif;?>
						
						<?php if($i % 2== 0):?>
						<div class="col col_1_2 omega">
							<div class="inner">
								<img src="<?=base_url('assets/post/'.$row['image_name'])?>" style="width:290px;height=180px" />
							</div>
						</div>
						<?php endif;?>
					
					</div>
				<?php 
					$i++;
					endforeach;?>	
				
            <div class="clear"></div>            
            </div>
            
            	<!-- author description 
                <div class="author-box">
                    <div class="author-description">
                		<div class="author-image"><img src="images/temp/author_image.jpg" alt=""><span class="author">the author</span></div>
                      	<div class="author-text">
                            <p>Britain’s phone <a href="#"><?=$post['user_name']?></a> hacking claimed another casualty on Monday when Yates, the deputy of London’s Metropolitan Police, resigned a day after the country’s top police officer quit and Rebekah Brooks, the former chief </p>
                        </div>
                        <div class="clear"></div>
                	</div>        
                </div>
                 author description -->
                
        </article>
					
						<!-- add comment -->
                        <div class="add-comment" id="addcomments">
                            <h3>Have something to say?</h3>
                            
                            <div class="comment-form">
                            <form action= "<?=site_url('post/saveComment')?>" method="post" id="commentForm">
                                 <?=form_hidden('id',$post['post_id'])?>
                                <div class="row field_textarea">
                                    <label class="label_title"><strong>Your Comment</strong></label>
                                    <textarea cols="30" rows="10" <?php if(!is_logged()) echo 'disabled="disabled"'; ?> name="comment" class="textarea textarea_middle required"><?php if(!is_logged()) echo 'You Must Login to Comment'; ?></textarea>
                                </div>
								
								<?php if(is_logged()):?>
									<div class="row rowSubmit">
										<input type="submit" value="Say it" class="btn-submit">
									</div>
								<?php endif;?>
                            </form>
							
                            </div>
                        </div>
						<!--/add comment -->
				
					<!-- post comments -->
					<div class="comment-list" id="comments">
                           
                        	<h2><?=COUNT($comment)?> Readers Commented</h2>
                            
                            <!--<a href="#addcomments" class="link-add-comment anchor">Join discussion</a>-->
                            
                            <ol>
							<?php foreach($comment as $post):?>
                                <li class="comment">
                                    <div class="comment-body">
                                    <div class="comment-avatar">
                                    	<div class="avatar"><img src="<?=base_url('assets/images/temp/avatar.jpg')?>" alt=""></div>
                                    </div>    
                                    <div class="comment-text">
                                    	<div class="comment-author">
                                        	<a href="<?=site_url('profile/index/'.$post['EmployeeID'])?>" class="link-author"><?=$post['user_name']?></a> <?php if($post['EmployeeID']==$this->session->userdata('user_login')):?> <a href="<?=site_url('post/removeComment/'.$post['comment_id'])?>" class="link-reply">Remove</a> <?php endif; ?> <span class="comment-date">on <?=$post['month'].' '.$post['day'].' '.$post['year']?></span>
                                        </div>
                                        <div class="comment-entry">
                                           <?=$post['comment_content']?>
                                      </div>
                                    </div>
                                    <div class="clear"></div>
                                    </div>
                                </li>
								<?php endforeach;?>
                                
                            </ol>
                        </div>
				<!--/ post comments -->
                
                
        
	</div>
    <!--/ content -->
    
    <!-- sidebar -->
    <div class="sidebar">

		<!-- recent entries -->
    	<div class="widget-container widget_recent_entries">
        	<img src="<?=base_url()?>/assets/images/icons/icons_16_date.png" alt="" class="widget_icon">  
			<h3 class="widget-title">Latest News</h3>
                <ul>
                    <?php foreach($latest as $rec): ?>
					<li>
                        <a href="<?=postUrl($rec['post_date'],$rec['post_id'],$rec['post_title'])?>"><img src="<?=base_url().thumb(postImage($rec['post_image']),seoUrl($rec['post_title']),100,200)?>" alt="" class="thumbnail"></a> 
                        <div class="recent_entry"><a href="<?=postUrl($rec['post_date'],$rec['post_id'],$rec['post_title'])?>" class="link-name"><?=$rec['post_title']?></a></div>
                    </li>
					<?php endforeach;?>
				</ul>
        </div>
    	<!--/ recent entries -->
        
        <!-- recent entries -->
    	<div class="widget-container widget_recent_entries">
        	<img src="<?=base_url()?>/assets/images/icons/icons_16_date.png" alt="" class="widget_icon">  
			<h3 class="widget-title">Latest Info</h3>
                <ul>
                    <?php foreach($latest2 as $rec): ?>
					<li>
                        <a href="<?=postUrl($rec['post_date'],$rec['post_id'],$rec['post_title'])?>"><img src="<?=base_url().thumb(postImage($rec['post_image']),seoUrl($rec['post_title']),100,200)?>" alt="" class="thumbnail"></a> 
                        <div class="recent_entry"><a href="<?=postUrl($rec['post_date'],$rec['post_id'],$rec['post_title'])?>" class="link-name"><?=$rec['post_title']?></a></div>
                    </li>
					<?php endforeach;?>
				</ul>
        </div>
    	<!--/ recent entries -->
                    
    </div>
    <!--/ sidebar -->
    
    <div class="divider"></div>
    
    
        	
</div>
<!--/ middle --> 
</div>
<!--/ container --> 